<%-- 
    Document   : mijnRitten
    Created on : 5-mei-2012, 15:41:00
    Author     : Niels Leguit <niels.leguit at hva.nl>
--%>
<%@taglib prefix="tl" tagdir="/WEB-INF/tags/" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <title>Project Digital Learning</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link href="css/default.css" rel="stylesheet" type="text/css" title="Style" /> 
    </head>
    <body>

        <jsp:include page="include/top_nav.jsp"/>

        <div id="header">
            <h1>Dryves</h1>
            <h2></h2>
        </div>

        <div id="wrapper">
            <div id="content">
                <div id="posts">
                    <div class="post">
                        <h2 class="title">Mijn Ritten</h2>
                        <div class="story">

                            <c:choose>
                                <c:when test="${aantalmijnritten != 0}">

                                    <table>
                                        <tr>
                                            <th align="left" width="15%"><b>Datum</b></th>
                                            <th align="left" width="10%"><b>Tijd</b></th>
                                            <th align="left" width="20%"><b>Van</b></th>
                                            <th width="5%"><b></b></th>
                                            <th align="left" width="20%"><b>Naar</b></th>
                                            <th width="5%"><b></b></th>
                                            <th width="5%"><b></b></th>
                                        </tr>
                                        <c:forEach var="tempRitten" items="${mijnritten}" varStatus="loop">
                                            <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">
                                                <td><fmt:formatDate value="${tempRitten.ritDatum}" pattern="dd/MM/yyyy"/></td>
                                                <td><fmt:formatDate value="${tempRitten.ritTijd}" pattern="HH:mm"/></td>
                                                <td>${tempRitten.ritVanPlaats}</td>
                                                <td><tl:LocToLoc /></td>
                                                <td>${tempRitten.ritNaarPlaats}</td>
                                                <td><a href="RitEdit?id=${tempRitten.ritId}"><tl:editIcon /></a></td>
<!--<img src="images/icons/16/018.png" title="edit"/> -->
                                                <c:choose>
                                                    <c:when test="${tempRitten.ritNrPlaatsen == 0}">
                                                        <td><a href="MijnRitten?id=${tempRitten.ritId}"><img src="images/icons/16/102.png" title="rit is vol"/></a></td>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <c:if test="${tempRitten.ritMeerijders > 0}">
                                                            <td><a href="MijnRitten?id=${tempRitten.ritId}"><img src="images/icons/16/043.png" title="nieuwe meerijders"/></a></td>
                                                        </c:if>
                                                        <c:if test="${tempRitten.ritMeerijders == 0}">
                                                        </c:if>   
                                                    </c:otherwise>
                                                </c:choose>
                                            </tr>
                                        </c:forEach>
                                    </table>
                                </c:when>
                                <c:otherwise>
                                    <b>Op dit moment heb je geen openstaande ritten</b>
                                </c:otherwise>


                            </c:choose>

                        </div>
                    </div>
                    <div class="post">
                        <h2 class="title">Mijn meerijders</h2>
                        <div class="story">
                            <c:choose>
                                <c:when test="${aantalmeerijders != 0}">

                                    <table>
                                        <c:forEach var="tempMee" items="${meerijders}" varStatus="loop">
                                            <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">
                                                <td>${tempMee.lidDisplaynaam}</td>
                                                <td><a href="AcceptRit?lidid=${tempMee.lidId}&id=${selectedritid}">Meerijder accepteren</a></td>
                                            </tr>
                                        </c:forEach>
                                    </table>
                                </c:when>
                            </c:choose>
                            <c:choose>     
                                <c:when test="${aantalmeerijdersaccepted != 0}">
                                    <table>
                                        <c:forEach var="tempMeeAcc" items="${meerijdersaccepted}" varStatus="loop">
                                            <tr class="${loop.index % 2 == 0 ? 'even' : 'odd'}">
                                                <td>${tempMeeAcc.lidDisplaynaam}</td>
                                                <td><b>Geaccepteerd!</b></td>
                                            </tr>
                                        </c:forEach>
                                    </table>
                                </c:when> 
                            </c:choose>
                        </div>
                    </div>
                </div>


                <div id="links">
                    <ul>
                        <jsp:include page="elements/links/myLinks.jsp" />
                        <jsp:include page="elements/links/quickLinks.jsp" />
                    </ul>
                </div>

                <div style="clear: both;">&nbsp;</div>  
            </div>
        </div>        

        <jsp:include page="include/footer.jsp"/>

    </body>
</html>


